let oIndexBtn1=$('#index-btn1');
let oIndexBtn2=$('#index-btn2');
let oIndexBtn3=$('#index-btn3');
let oIndexBtn4=$('#index-btn4');
let oIndexBtn5=$('#index-btn5');
let oIndexBtn6=$('#index-btn6');
let oIndexBtn7=$('#index-btn7');
let data=JSON.parse(localStorage.getItem('data'));
function sss() {
    console.log(data.aUser)
   for (let i=0;i<data.aUser.length;i++)  {

       if (data.aUser[i].type===0) {
           oIndexBtn1.attr("disabled",true)
           oIndexBtn2.attr("disabled",true)
           oIndexBtn3.attr("disabled",true)
           oIndexBtn4.attr("disabled",true)
           oIndexBtn5.attr("disabled",true)
           oIndexBtn6.attr("disabled",true)
           oIndexBtn7.attr("disabled",true)
       }else if (data.aUser[i].type!=0) {
           oIndexBtn1.attr("disabled",false)
           oIndexBtn2.attr("disabled",false)
           oIndexBtn3.attr("disabled",false)
           oIndexBtn4.attr("disabled",false)
           oIndexBtn5.attr("disabled",false)
           oIndexBtn6.attr("disabled",false)
           oIndexBtn7.attr("disabled",false)
       }
   }
};
sss();
let oF=$('#oF');
let oB=$('#oB');
let oImg=$('#index-information-img1');
let oImg1=$('#index-information-img2');
oB.click(function(){
    let oFReader = new FileReader();
    let file = oF[0].files[0];
    oFReader.readAsDataURL(file);
    oFReader.onloadend = function (ev) {
        let src1 = ev.target.result;
        oImg.attr('src',src1);
        oImg1.attr('src',src1);

    }});

let oIiinp1=$('#index-information-inp1');
let oIiinp2=$('#index-information-inp2');
let oIiinp3=$('#index-information-inp3');
let oIiinp4=$('#index-information-inp4');
let oIiinp5=$('#index-information-inp5');
let oIspan=$('#index-information-span');


let data2=JSON.parse(localStorage.getItem('data2'));
data2.aInforamtion.forEach(function (v,i) {
    oIiinp1.val(v.name);
    oIspan.text(v.name);
    oIiinp2.val(v.sex);
    oIiinp3.val(v.day);
    oIiinp4.val(v.tel);
    oIiinp5.val(v.adress)

});

let oIbtn=$('#index-information-btn');
let oIbtn2=$('#index-information-btn2');

function ss(){
        oIiinp1.attr("disabled",false)
        oIiinp2.attr("disabled",false)
        oIiinp3.attr("disabled",false)
        oIiinp4.attr("disabled",false)
        oIiinp5.attr("disabled",false)
}
function cc(){
    oIiinp1.attr("disabled",true)
    oIiinp2.attr("disabled",true)
    oIiinp3.attr("disabled",true)
    oIiinp4.attr("disabled",true)
    oIiinp5.attr("disabled",true)
}
oIbtn.click(
    function (event) {
        event.stopPropagation();
        ss()
    }
);
oIbtn2.click(
    function (event) {
        event.stopPropagation();
        cc();
        let oInd=$('.modal-backdrop')
        let oInd1=$('.modal')
        oInd.css({display:'none'})
        oInd1.css({display:'none'})
    }
);




